using SAWD.AI;
using System.Collections.Generic;
using UnityEngine;

public class CubeMove : MonoBehaviour
{
    Dictionary<int, Point> points = new();

    private void Start()
    {
        foreach (var point in FindObjectsOfType<Point>())
        {
            points[point.pointNumber] = point;
            points[point.gameObject.GetInstanceID()] = point;
            Debug.Log(point.GetInstanceID() + " - " + point.name);
        }
    }


    [AI("Двигает куб на точку")]
    public void MoveToPoint([AI("Номер точки")] int pointNumber)
    {
        this.transform.position = points[pointNumber].transform.position;
    }

    [AI("Меняет размер")]
    public void Resize([AI("от 0.001 до 2")] int size)
    {
        this.transform.localScale = new Vector3(size, size, size);
    }

    [AI("Меняет цвет")]
    public void Colorize(int r, int g, int b)
    {
        GetComponent<Renderer>().material.color = new Color(r, g, b);
    }
}
